window.onload=function () {
    var app = new Vue({
        el: "#app",
        data: {
            pagination: {
                total: 0, //总记录数
                pageSize: 10, //每页的记录数
                pageNum: 1, //当前页码
            },
            userlist:[],//所有回答
            user:{
                uid:0,
                state:""
            },
            myvalues:""
        },
        methods: {
            inituserlist(){
                //初始化数据
                methodaxios.get(null,"/user/userlist?currentPage="+this.pagination.pageNum+"&pageSize="+this.pagination.pageSize+"&date="+new Date(),rep=>{
                    window.console.log("我进来了")
                    window.console.log(rep)
                    window.console.log("=======================")
                    this.userlist=rep.data.data;
                    this.pagination.total=rep.data.count;
                });
            },//当前页发送改变
            findBlogPageList(page) {
                //页数改变
                this.pagination.pageNum = page;
                this.inituserlist();
            }, //每页大小发送改变
            sizeChange(size) {
                this.pagination.pageSize = size; //当前页显示多少
                this.pagination.pageNum = 1;
                this.inituserlist();
            },
            updatemyswitch(row){//点击状态按钮
                if(row.state==="1"){///user/updatestate
                    this.user.state=0
                }else{
                    this.user.state=1
                }
                this.user.uid=row.uid;
                methodaxios.get( this.user,"/user/updatestate",rep=>{
                    if(rep.data.code==="200"){
                        this.inituserlist();
                    }
                });
            }
        },mounted(){
            this.inituserlist();
        },
        filters:{
            mytime(value){
                var dateee = new Date( value).toJSON();
                return new Date(+new Date(dateee) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '')
            }
        }

    })
}
